package com.inteligencia.stage.services.task.quartz;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class SchedulerJob extends QuartzJobBean {

    private SchedulerTask schedulerTask;

    public void setSchedulerTask(SchedulerTask schedulerTask) {
        this.schedulerTask = schedulerTask;
    }

    @Override
    protected void executeInternal(JobExecutionContext context)
            throws JobExecutionException {
        try {
            schedulerTask.printSchedulerMessage();
        } catch (Exception ex) {
            Logger.getLogger(SchedulerJob.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
